package com.coffee.controller;


import com.coffee.conmmon.BaseResult;
import com.coffee.service.CofferService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/coffee")
@Api(description="咖啡详情相关接口")
@CrossOrigin
public class CoffeeController {
    @Resource
    CofferService cofferService;

     /*findAll  传个id  根据一级查询二级
       selectAll  查询所有（包括一二级分类）
       selectOne  查询左面 （一级菜单）
       goods 查询右面  （咖啡详情）
*/
    @RequestMapping(value = "/findAll",method = RequestMethod.POST)
    @ApiOperation("传个id  根据一级查询二级")
    public BaseResult findAll(@RequestBody Integer cotid){
       /* System.out.println(cofferService.findAll(cotid));*/
        return cofferService.findAll(cotid);
    }
    @ApiOperation("查询所有（包括一二级分类）")
    @RequestMapping(value = "/selectAll",method = RequestMethod.POST)
    public BaseResult selectAll(){
       /* System.out.println(cofferService.selectAll());*/
        return cofferService.selectAll();
    }
    @ApiOperation("查询左面 （一级菜单）")
    @RequestMapping(value = "/selectOne",method = RequestMethod.POST)
    public BaseResult selectOne(){
        return cofferService.selectOne();
    }
    @ApiOperation("查询右面  （咖啡详情）")
    @RequestMapping(value = "/goods",method = RequestMethod.POST)
    public BaseResult goods(){
        return cofferService.goods();
    }


}
